package com.yx.changdao.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yx.changdao.common.entity.Problem;
import com.yx.changdao.common.entity.ProblemInfo;
import com.yx.changdao.common.exception.AlertException;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Description: <br/>
 * 问题信息(在分配之前)
 * <p>
 * <br/>
 * @Auther: xiapeixin
 * @create 2020/05/06 09:51
 */
public interface ProblemInfoService extends IService<ProblemInfo> {

    /**
     * 预处理,擦除不允许更新的列;
     */
    void advance(ProblemInfo problemInfo);

    /**
     * 保存问题;
     * isStrict 是否为严格模式,
     *   true遇到错误将会抛出异常; (单个录入)
     *   false遇到错误跳过;(批量导入)
     */
    boolean saveOrUpdateProblem(ProblemInfo problemInfo,boolean isStrict) throws AlertException;

    /**
     * (批量)检查并且保存, 会把不符合规范的返回
     *
     * @param problem
     */
    List<ProblemInfo> checkAndSave(MultipartFile problem) throws AlertException;

    /**
     * 删除问题和打回记录
     */
    boolean deleteProblem(Integer proId) throws AlertException;

    /**
     * 问题上报给管理员
     */
    boolean reportManager(Integer proinfoId) throws AlertException;

    /**
     * 问题批量上报给管理员
     */
    boolean reportBatchManager(List<Integer> proinfoIds) throws AlertException;

    /**
     * 管理员驳回上报
     */
    boolean rejectManager(Integer proinfoId) throws AlertException;

    /**
     * 问题上报
     */
    boolean report(Integer proinfoId) throws AlertException;

    /**
     * 问题批量上报
     */
    boolean reportBatch(List<Integer> proinfoIds) throws AlertException;

    /**
     * 批量驳回/同意上报
     * type 3 打回, type 2 通过,
     */
    boolean rejectOrAgreeBatch(List<Integer> proIds, String content, Integer type) throws AlertException;


}
